Skip to content

feat(grouper): add slow handle diagnostics#549

Open
Kuchizu wants to merge 5 commits into
masterfrom
feat/grouper-slow-diagnostics
Open

feat(grouper): add slow handle diagnostics#549
Kuchizu wants to merge 5 commits into
masterfrom
feat/grouper-slow-diagnostics

Conversation

@Kuchizu
Copy link
Copy Markdown
Member

@Kuchizu Kuchizu commented May 4, 2026

Adds Grouper slow-handle diagnostics to identify which processing step causes high handle duration.

Comment thread workers/grouper/src/index.ts Outdated
Comment thread workers/grouper/src/index.ts Outdated
@Kuchizu Kuchizu requested a review from neSpecc May 6, 2026 12:18
neSpecc
neSpecc previously approved these changes May 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds slow-handle diagnostics to the Grouper worker to help pinpoint which parts of handleInternal() contribute most to high end-to-end handle duration.

Changes:

  • Introduces SlowHandleDiagnostics / SlowHandleSession to time per-handle steps and emit a slow-handle warning with a step breakdown.
  • Extends GrouperMetrics with a per-step duration histogram and custom handle-duration buckets.
  • Adds env-driven diagnostics config (GROUPER_SLOW_HANDLE_WARN_MS) and instruments handleInternal() plus several Mongo operations.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
workers/grouper/src/metrics/slowHandleDiagnostics.ts New per-handle session helper that measures steps and logs a slow-handle breakdown.
workers/grouper/src/metrics/grouperMetrics.ts Adds GrouperStep + step-duration histogram and custom handle-duration buckets.
workers/grouper/src/metrics/config.ts Adds diagnostics config + env parsing for slow-handle warning threshold.
workers/grouper/src/index.ts Instruments handleInternal() steps, adds slow-handle session usage, and wraps additional Mongo ops for duration metrics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread workers/grouper/src/metrics/slowHandleDiagnostics.ts
Comment thread workers/grouper/src/metrics/slowHandleDiagnostics.ts
Comment thread workers/grouper/src/index.ts
Comment thread workers/grouper/src/index.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants